﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;

namespace BiSA
{
    class UserDataDetails
    {
        public string DataLabel="";
        public string Description="";
        public string TotalIntervals = "";
        public DateTime EnteredTime;

        public UserDataDetails(string UserDataDetailId)
        {
            string sql = "";
            sql = "select *, (select count(*) TotalIntervals from UserTFSites where UserDataDetailId=@UserDataDetailId ) TotalIntervals";
            sql += " from UserDataDetails where UserDataDetailId=@UserDataDetailId";
            SqlCommand cm = MKDataAccesser.CreateCommand(sql, CommandType.Text);
            cm.Parameters.Add(new SqlParameter("@UserDataDetailId", UserDataDetailId));
            DataSet ds = MKDataAccesser.GetRecord(cm);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DataLabel = dr["DataLabel"].ToString();
                TotalIntervals = dr["TotalIntervals"].ToString();
                //EnteredTime = dr["EnteredTime"];
            }
        }
    }
}
